﻿using PRO.Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace PRO.DbProvider
{
    public interface IDataProvider
    {
        #region 后台管理员
        DataTable GetAdminInfo(string username);
        bool RePwd(int id, string oldpwd, string newpwd);
        #endregion

        #region 产品分类
        DataTable GetClass();
        bool AddClass(ClassInfo info);
        bool DelClass(int id, out string msg);
        DataTable GetClassInfo(int id);
        bool EditClass(ClassInfo info);
        #endregion

        #region 会员管理
        bool IsExistUser(string username);
        int AddUser(UserInfo ui);
        DataTable GetUserInfo(string username);
        #endregion

        #region 产品管理
        int AddProduct(ProductInfo info);
        DataTable GetProductInfo(int id);
        bool EditProduct(ProductInfo info);
        bool DelProduct(int id);
        #endregion

        #region 购物车管理
        DataTable GetCartItems(string ids);
        #endregion

        #region 收藏夹
        int AddToFavorite(FavoriteInfo info);
        bool DelToFavorite(int id, int userid);
        #endregion

        #region 收货地址管理
        bool AddDeliver_Address(Deliver_address_Info info);
        DataTable GetMyDeliver_Address(int userid);
        DataTable GetDeliver_Address(int id, int userid);
        bool SetDefault(int id, int userid);
        bool DelDeliver_Address(int id, int userid);
        #endregion

        #region 礼品卡管理
        int CreateCashCoupon(CashCouponInfo info);
        bool SetSoldOver(int id);
        bool DelCashCoupon(int id);
        DataTable GetCashCoupon(string number);
        #endregion

        #region 订单管理
        int CreateOrder(OrderInfo order, DataTable products);
        DataTable GetOrderInfo(int id, int userid);
        DataTable GetOrderItems(int orderid);
        #endregion
    }
}
